package mysql

import "gorm.io/gorm"

type Goods struct {
	gorm.Model
	Name    string  `gorm:"type:varchar(20);not null;comment:'名称'"`
	Image   string  `gorm:"type:varchar(500);not null;comment:'图片'"`
	Price   float64 `gorm:"type:decimal(10,2)not null;comment:'价格'"`
	BrandId int64   `gorm:"type:int(20);not null;comment:'品牌id'"`
	ClassId int64   `gorm:"type:int(20);not null;comment:'分类id'"`
}

// 品牌表
type Brand struct {
	gorm.Model
	Name string `gorm:"type:varchar(30);not null;comment:'品牌名称'"`
}

// 分类表
type Class struct {
	gorm.Model
	Name string `gorm:"type:varchar(30);not null;comment:'分类名称'"`
}

type GoodsData struct {
	Goods
	BrandName string
	ClassName string
}
